/*
 * @Description: IBE信息化平台
 * @Author: IBE
 * @Date: 2020-05-14 13:58:52
 * @LastEditTime: 2020-07-01 10:02:41
 * @LastEditors: yang
 */
import request from "@/utils/request"
const BASE_URL = process.env.VUE_APP_BASE_URL_HRM

/**
 * 部门列表
 * @param {*} data
 */
export function hrmDeptQueryTreeListAPI(data) {
	return request({
		url: BASE_URL + "hrmDept/queryTreeList",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 部门新建
 * @param {*} data
 */
export function hrmDeptAddDeptAPI(data) {
	return request({
		url: BASE_URL + "hrmDept/addDept",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 部门部门
 * @param {*} data
 */
export function hrmDeptSetDeptAPI(data) {
	return request({
		url: BASE_URL + "hrmDept/setDept",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}

/**
 * 查询部门详情
 * @param {*} data
 */
export function hrmDeptQueryByIdAPI(id) {
	return request({
		url: BASE_URL + `hrmDept/queryById/${id}`,
		method: "post"
	})
}

/**
 * 查询部门删除
 * @param {*} data
 */
export function hrmDeptDeleteByIdAPI(id) {
	return request({
		url: BASE_URL + `hrmDept/deleteDeptById/${id}`,
		method: "post"
	})
}

/**
 * 通过部门id查询员工列表
 * @param {*} data
 */
export function hrmDeptQueryEmployeeAPI(data) {
	return request({
		url: BASE_URL + "hrmDept/queryEmployeeByDeptId",
		method: "post",
		data: data,
		headers: {
			"Content-Type": "application/json;charset=UTF-8"
		}
	})
}
